import { request } from '@pkg/request/src';

export enum Api {
  page = '/viproom/page',
  list = '/viproom/list',
  get = '/viproom/get',
  add = '/viproom/save',
  update = '/viproom/update',
  remove = '/viproom/remove',
  queryViproomServer = '/viproom/queryViproomServer',
  setViproomServer = '/viproom/setViproomServer',
  viproomserverList = '/viproomserver/list',
  setAirportExclude = '/excludeGoods/setAirportExclude',
}

export const viproomList = params =>
  request.get(
    {
      url: Api.list,
      params: params,
    },
    { errorMessageMode: 'none', successMessageMode: 'none' },
  );

export const getVipRoomDetail = params =>
  request.get(
    { url: Api.get, params: params },
    {
      errorMessageMode: 'none',
      successMessageMode: 'none',
    },
  );

export const add = params =>
  request.post(
    {
      url: Api.add,
      params: params,
    },
    { errorMessageMode: 'message' },
  );

export const update = params =>
  request.post(
    {
      url: Api.update,
      params: params,
    },
    { errorMessageMode: 'message' },
  );

export const queryViproomServer = params =>
  request.get(
    {
      url: Api.queryViproomServer,
      params: params,
    },
    { errorMessageMode: 'message' },
  );

export const setViproomServer = params =>
  request.post(
    {
      url: Api.setViproomServer,
      params: params,
    },
    { errorMessageMode: 'message' },
  );
export const viproomserverList = params =>
  request.get(
    {
      url: Api.viproomserverList,
      params: params,
    },
    { errorMessageMode: 'message' },
  );
export const setAirportExclude = params =>
  request.post(
    {
      url: Api.setAirportExclude,
      params: params,
    },
    { errorMessageMode: 'none', successMessageMode: 'success' },
  );
